<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>共享米宝管理后台 - 收益管理</title>
    <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.15.12/lib/theme-chalk/index.css">
    <link rel="stylesheet" href="../assets/css/custom.css">
</head>
<body class="bg-gray-100">
    <div class="admin-container flex">
        <!-- Sidebar -->
        <div class="w-64 bg-gray-800 min-h-screen flex-shrink-0">
            <div class="p-4 text-white">
                <div class="flex items-center mb-6">
                    <i class="fas fa-bolt mr-2 text-yellow-400"></i>
                    <span class="text-lg font-medium">共享米宝管理系统</span>
                </div>
                
                <nav>
                    <a href="index.html" class="block py-2 px-4 rounded hover:bg-gray-700 mb-1">
                        <i class="fas fa-chart-line mr-2"></i> 控制台
                    </a>
                    <a href="users.html" class="block py-2 px-4 rounded hover:bg-gray-700 mb-1">
                        <i class="fas fa-users mr-2"></i> 用户管理
                    </a>
                    <a href="investors.html" class="block py-2 px-4 rounded hover:bg-gray-700 mb-1">
                        <i class="fas fa-user-tie mr-2"></i> 投资人管理
                    </a>
                    <a href="devices.html" class="block py-2 px-4 rounded hover:bg-gray-700 mb-1">
                        <i class="fas fa-battery-full mr-2"></i> 设备管理
                    </a>
                    <a href="revenue.html" class="block py-2 px-4 rounded bg-gray-700 mb-1">
                        <i class="fas fa-money-bill-wave mr-2"></i> 收益管理
                    </a>
                    <a href="commission-settings.html" class="block py-2 px-4 rounded hover:bg-gray-700 mb-1">
                        <i class="fas fa-cog mr-2"></i> 分润设置
                    </a>
                </nav>
            </div>
        </div>

        <!-- Main content -->
        <div class="flex-grow">
            <!-- Header -->
            <header class="bg-white shadow-sm">
                <div class="container mx-auto px-4 py-3 flex justify-between items-center">
                    <h1 class="text-xl font-medium">收益管理</h1>
                    <div class="flex items-center">
                        <span class="mr-4">管理员</span>
                        <img class="h-8 w-8 rounded-full" src="https://via.placeholder.com/40" alt="管理员头像">
                    </div>
                </div>
            </header>

            <!-- Page content -->
            <main class="container mx-auto p-4">
                <!-- Revenue Stats -->
                <div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-6">
                    <div class="bg-white rounded-lg shadow-sm p-6">
                        <div class="flex justify-between items-start">
                            <div>
                                <p class="text-gray-500 text-sm">本月总收入</p>
                                <h3 class="text-2xl font-bold mt-1">¥25,841</h3>
                                <p class="text-green-500 text-xs mt-2">
                                    <i class="fas fa-arrow-up mr-1"></i> 18% 较上月
                                </p>
                            </div>
                            <div class="bg-blue-100 p-3 rounded-full">
                                <i class="fas fa-money-bill-wave text-blue-500"></i>
                            </div>
                        </div>
                    </div>

                    <div class="bg-white rounded-lg shadow-sm p-6">
                        <div class="flex justify-between items-start">
                            <div>
                                <p class="text-gray-500 text-sm">本月租赁收入</p>
                                <h3 class="text-2xl font-bold mt-1">¥18,632</h3>
                                <p class="text-green-500 text-xs mt-2">
                                    <i class="fas fa-arrow-up mr-1"></i> 15% 较上月
                                </p>
                            </div>
                            <div class="bg-green-100 p-3 rounded-full">
                                <i class="fas fa-battery-full text-green-500"></i>
                            </div>
                        </div>
                    </div>

                    <div class="bg-white rounded-lg shadow-sm p-6">
                        <div class="flex justify-between items-start">
                            <div>
                                <p class="text-gray-500 text-sm">本月WiFi收入</p>
                                <h3 class="text-2xl font-bold mt-1">¥7,209</h3>
                                <p class="text-green-500 text-xs mt-2">
                                    <i class="fas fa-arrow-up mr-1"></i> 23% 较上月
                                </p>
                            </div>
                            <div class="bg-yellow-100 p-3 rounded-full">
                                <i class="fas fa-wifi text-yellow-500"></i>
                            </div>
                        </div>
                    </div>

                    <div class="bg-white rounded-lg shadow-sm p-6">
                        <div class="flex justify-between items-start">
                            <div>
                                <p class="text-gray-500 text-sm">本月分润支出</p>
                                <h3 class="text-2xl font-bold mt-1">¥12,920</h3>
                                <p class="text-green-500 text-xs mt-2">
                                    <i class="fas fa-arrow-up mr-1"></i> 20% 较上月
                                </p>
                            </div>
                            <div class="bg-purple-100 p-3 rounded-full">
                                <i class="fas fa-chart-pie text-purple-500"></i>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Revenue Filter -->
                <div class="bg-white rounded-lg shadow-sm p-6 mb-6">
                    <div class="flex flex-wrap gap-4">
                        <!-- Date Range -->
                        <div class="flex-grow min-w-[300px]">
                            <label class="block text-sm text-gray-600 mb-1">时间范围</label>
                            <div class="flex space-x-2">
                                <input type="date" class="border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                                <span class="self-center">至</span>
                                <input type="date" class="border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                            </div>
                        </div>

                        <!-- Revenue Type -->
                        <div class="w-48">
                            <label class="block text-sm text-gray-600 mb-1">收入类型</label>
                            <select class="w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                                <option value="">全部</option>
                                <option value="rental">租赁收入</option>
                                <option value="wifi">WiFi收入</option>
                            </select>
                        </div>

                        <!-- Commission Type -->
                        <div class="w-48">
                            <label class="block text-sm text-gray-600 mb-1">分润类型</label>
                            <select class="w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                                <option value="">全部</option>
                                <option value="investor">投资人分润</option>
                                <option value="referral">推荐分润</option>
                                <option value="recruiter">招商分润</option>
                            </select>
                        </div>

                        <!-- Search Button -->
                        <div class="self-end">
                            <button class="bg-blue-500 text-white px-6 py-2 rounded-md">
                                搜索
                            </button>
                        </div>
                    </div>
                </div>

                <!-- Revenue Charts -->
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
                    <!-- Revenue Trend Chart -->
                    <div class="bg-white rounded-lg shadow-sm p-6">
                        <div class="flex justify-between items-center mb-4">
                            <h2 class="text-lg font-medium">收入趋势</h2>
                            <select class="border border-gray-300 rounded-md px-2 py-1 text-sm">
                                <option>近7天</option>
                                <option>近30天</option>
                                <option>近90天</option>
                            </select>
                        </div>
                        
                        <!-- Placeholder for chart -->
                        <div class="h-64 bg-gray-50 rounded-lg flex items-center justify-center">
                            <div class="text-center">
                                <i class="fas fa-chart-line text-gray-400 text-4xl mb-2"></i>
                                <div class="text-gray-500">收入趋势图表</div>
                            </div>
                        </div>
                    </div>

                    <!-- Revenue Distribution Chart -->
                    <div class="bg-white rounded-lg shadow-sm p-6">
                        <div class="flex justify-between items-center mb-4">
                            <h2 class="text-lg font-medium">收入分布</h2>
                            <select class="border border-gray-300 rounded-md px-2 py-1 text-sm">
                                <option>本月</option>
                                <option>上月</option>
                                <option>近3个月</option>
                            </select>
                        </div>
                        
                        <!-- Placeholder for chart -->
                        <div class="h-64 bg-gray-50 rounded-lg flex items-center justify-center">
                            <div class="text-center">
                                <i class="fas fa-chart-pie text-gray-400 text-4xl mb-2"></i>
                                <div class="text-gray-500">收入分布图表</div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Revenue Details -->
                <div class="bg-white rounded-lg shadow-sm p-6 mb-6">
                    <div class="flex justify-between items-center mb-6">
                        <h2 class="text-lg font-medium">收益明细</h2>
                        <button class="bg-green-500 text-white px-4 py-2 rounded-md text-sm flex items-center">
                            <i class="fas fa-file-export mr-2"></i>
                            导出Excel
                        </button>
                    </div>

                    <div class="overflow-x-auto">
                        <table class="min-w-full divide-y divide-gray-200">
                            <thead>
                                <tr>
                                    <th class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">交易ID</th>
                                    <th class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">日期</th>
                                    <th class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">收入类型</th>
                                    <th class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">设备ID</th>
                                    <th class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">用户</th>
                                    <th class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">金额</th>
                                    <th class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">状态</th>
                                </tr>
                            </thead>
                            <tbody class="bg-white divide-y divide-gray-200">
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium">TRX123456</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm">2023-05-18 14:23</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm">
                                        <span class="px-2 py-1 text-xs rounded-full bg-green-100 text-green-700">充电宝租赁</span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm">MB12345</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm">
                                        <div class="flex items-center">
                                            <img class="h-6 w-6 rounded-full mr-2" src="https://via.placeholder.com/30" alt="用户头像">
                                            <div>
                                                <div class="text-sm font-medium">李小明</div>
                                                <div class="text-xs text-gray-500">UID: U20230518</div>
                                                <div class="text-xs text-gray-500">手机: 138****5678</div>
                                            </div>
                                        </div>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-green-600">+¥5.00</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm">
                                        <span class="px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-700">已完成</span>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium">TRX123457</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm">2023-05-18 13:45</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm">
                                        <span class="px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-700">WiFi服务</span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm">MB12345</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm">
                                        <div class="flex items-center">
                                            <img class="h-6 w-6 rounded-full mr-2" src="https://via.placeholder.com/30" alt="用户头像">
                                            <div>
                                                <div class="text-sm font-medium">王小红</div>
                                                <div class="text-xs text-gray-500">UID: U20230517</div>
                                                <div class="text-xs text-gray-500">手机: 159****1234</div>
                                            </div>
                                        </div>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-green-600">+¥3.00</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm">
                                        <span class="px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-700">已完成</span>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium">TRX123458</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm">2023-05-18 12:32</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm">
                                        <span class="px-2 py-1 text-xs rounded-full bg-purple-100 text-purple-700">分润支出</span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm">-</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm">
                                        <div class="flex items-center">
                                            <img class="h-6 w-6 rounded-full mr-2" src="https://via.placeholder.com/30" alt="投资人头像">
                                            <div>
                                                <div class="text-sm font-medium">张志强</div>
                                                <div class="text-xs text-gray-500">UID: U20230402</div>
                                                <div class="text-xs text-gray-500">手机: 186****8888</div>
                                            </div>
                                        </div>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-red-600">-¥25.60</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm">
                                        <span class="px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-700">已结算</span>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>

                    <!-- Pagination -->
                    <div class="flex justify-between items-center mt-6">
                        <div class="text-sm text-gray-500">
                            显示 1-10 条，共 156 条
                        </div>
                        <div class="flex space-x-1">
                            <button class="px-3 py-1 border border-gray-300 rounded-md text-sm bg-gray-50">
                                <i class="fas fa-chevron-left"></i>
                            </button>
                            <button class="px-3 py-1 border border-gray-300 rounded-md text-sm bg-blue-500 text-white">
                                1
                            </button>
                            <button class="px-3 py-1 border border-gray-300 rounded-md text-sm">
                                2
                            </button>
                            <button class="px-3 py-1 border border-gray-300 rounded-md text-sm">
                                3
                            </button>
                            <button class="px-3 py-1 border border-gray-300 rounded-md text-sm">
                                4
                            </button>
                            <button class="px-3 py-1 border border-gray-300 rounded-md text-sm">
                                5
                            </button>
                            <button class="px-3 py-1 border border-gray-300 rounded-md text-sm bg-gray-50">
                                <i class="fas fa-chevron-right"></i>
                            </button>
                        </div>
                    </div>
                </div>
            </main>
        </div>
    </div>

    <!-- JavaScript for functionality -->
    <script>
        // Here would be JavaScript code to handle button clicks and interactions
        document.addEventListener('DOMContentLoaded', function() {
            // Add event listeners for buttons
            const buttons = document.querySelectorAll('button');
            buttons.forEach(button => {
                button.addEventListener('click', function(e) {
                    console.log('Button clicked:', this.textContent.trim());
                    // Additional functionality would be added here
                });
            });
            
            // Add event listeners for links
            const links = document.querySelectorAll('a');
            links.forEach(link => {
                link.addEventListener('click', function(e) {
                    // Prevent default only for # links that don't have a real destination
                    if (this.getAttribute('href') === '#') {
                        e.preventDefault();
                        console.log('Link clicked:', this.textContent.trim());
                    }
                });
            });
        });
    </script>
</body>
</html> 